import request from '@/utils/request'

export function dicList(dic_code) {
  return request({
    url: '/api/sys/dic/all',
    method: 'post',
    data: {
      dic_code: dic_code
    }
  })
}

export function save(form) {
  return request({
    url: '/api/sys/dic/save',
    method: 'post',
    data: {
      dic_code: form.dic_code,
      dic_name: form.dic_name,
      dic_pcode: form.dic_pcode,
      dic_desc: form.dic_desc
    }
  })
}

export function update(form) {
  return request({
    url: '/api/sys/dic/update',
    method: 'post',
    data: {
      dic_code: form.dic_code,
      dic_pcode: form.dic_pcode,
      dic_name: form.dic_name,
      dic_id: form.dic_id,
      dic_desc: form.dic_desc
    }
  })
}

export function cache() {
  return request({
    url: '/api/sys/dic/cache',
    method: 'post',
    data: { }
  })
}

export function disable(dic_id) {
  return request({
    url: '/api/sys/dic/disable',
    method: 'post',
    data: {
      dic_id: dic_id
    }
  })
}

export function enable(dic_id) {
  return request({
    url: '/api/sys/dic/enable',
    method: 'post',
    data: {
      dic_id: dic_id
    }
  })
}
